#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
	set -- php-fpm "$@"
fi

#Cron
touch /var/log/cron.log
chmod 0644 /etc/cron.d/proj-cron
/usr/bin/crontab /etc/cron.d/proj-cron
cron &

#Supervisor
supervisord --configuration /etc/supervisor/supervisord.conf

exec "$@"